#! /usr/bin/perl
binmode STDIN;
while (<>) {
  if (/4p-(bytecode|gunzip)/) {
    $_ .= join('', <>);
  } else {
    next if /^\s*[|\\]\s/ || /^\s*$/
          || /^\s*((purpose)|(license)|(copyright)|(status)):\s/;
  }
  if (/^\s*include\s+(\S+)\s*$/) {
    print STDERR "$1\n";
    my $add = `perl $0 <$1`;
    $add =~ s/#define SIZE (\d+)\n$//;
    $size += $1;
    print $add;
  } else {
    s/^\s+//;
    s/\s+$//;
    if (! /L"/ && ! /4p-(bytecode|gunzip)/) {
      s/\s+/ /g;
      s/\r?\n//s;
    }
    print "$_\n";
  }
}
